home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # $Id: architecture,v 3.4 1992/03/03 18:05:00 rensing Rel $
- #
- # Copyright (C) 1992 The Board of Trustees of The Leland Stanford
- # Junior University. All Rights Reserved.
-
-
- # simple way of overriding all other tests
- if test -n "$ARCH"; then
- echo $ARCH
- exit 0
- fi
-
- if test -n "${HOSTTYPE}"; then
- case "${HOSTTYPE}" in
- rs6000)
- echo aix6000 ;;
- decstation)
- echo ultrix ;;
- iris4d)
- echo sgi ;;
- *)
- echo ${HOSTTYPE} ;;
- esac
- exit 0
- fi
-
- cat /etc/motd | grep ULTRIX >/dev/null
- if test $? -eq 0; then
- echo ultrix
- exit 0
- fi
-
- cat /etc/motd | grep -i AIX >/dev/null
- if test $? -eq 0; then
- echo aix6000
- exit 0
- fi
-
- cat /etc/motd | grep -i SunOS >/dev/null
- if test $? -eq 0; then
- echo sun4
- exit 0
- fi
-
- /bin/4d > /dev/null 2> /dev/null
- if test $? -eq 0; then
- echo sgi
- exit 0
- fi
-
- /bin/arch > /dev/null 2> /dev/null
- if test $? -eq 0; then
- echo `/bin/arch`
- exit 0
- fi
-
- /bin/uname > /dev/null 2> /dev/null
- if test $? -eq 0; then
- case "`/bin/uname`" in
- SunOS)
- echo sun4 ;;
- AIX)
- echo aix6000 ;;
- ULTRIX)
- echo ultrix ;;
- SGI)
- echo sgi ;;
- *)
- echo `/bin/uname` ;;
- esac
- exit 0
- fi
-
- # The Next is a pain
- # no uname, no motd, arggh
- hostinfo > /dev/null 2>/dev/null
- if test $? -eq 0; then
- hostinfo |grep -i NeXT > /dev/null 2> /dev/null
- if test $? -eq 0; then
- echo next
- exit 0
- fi
- fi
-
- if test -d /NextLibrary; then
- echo next
- exit 0
- fi
-
- if test -f /usr/bin/dread; then
- echo next
- exit 0
- fi
-
- if test -f /etc/svc.conf; then
- echo ultrix
- exit 0
- fi
-
- exit 1
-
-
-